projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c7539ce
)
proto-shell: use calloc_a
author
Felix Fietkau
<
[email protected]
>
Sat, 5 Jan 2013 15:13:29 +0000
(16:13 +0100)
committer
Felix Fietkau
<
[email protected]
>
Sat, 5 Jan 2013 15:13:29 +0000
(16:13 +0100)
Signed-off-by: Felix Fietkau <
[email protected]
>
proto-shell.c
patch
|
blob
|
history
diff --git
a/proto-shell.c
b/proto-shell.c
index 038fb0b8ff7e980babed5934386a114de6277f19..02f1836d8da4764fb37ff82cd014fff739afa431 100644
(file)
--- a/
proto-shell.c
+++ b/
proto-shell.c
@@
-813,15
+813,12
@@
proto_shell_add_handler(const char *script, json_object *obj)
name = json_object_get_string(tmp);
- handler = calloc(1, sizeof(*handler) +
- strlen(script) + 1 +
- strlen(name) + 1);
+ handler = calloc_a(sizeof(*handler) + strlen(script) + 1,
+ &str, strlen(name) + 1);
if (!handler)
return;
strcpy(handler->script_name, script);
-
- str = handler->script_name + strlen(handler->script_name) + 1;
strcpy(str, name);
proto = &handler->proto;